/*
    The NeonX Library

    Copyright (c) 2013 darkcat

    Code covered by the MIT License
*/

#pragma once

// nx...
#include "config/general.h"
// NX_ALLOC
#include "memory/memalloc.h"

// std::list
#include <list>

//////////////////////////////////////////////////////////////////////////
NX_BEG
//////////////////////////////////////////////////////////////////////////

template <typename Type_, class Alloc_ = NX_ALLOC>
class list : public std::list<Type_, typename Alloc_::template Allocator<Type_>::ret>
{
public:
    typedef std::list<Type_, typename Alloc_::template Allocator<Type_>::ret> base_t;

public:
    list()
        : base_t()
    {}
    list(const base_t& x)
        : base_t(x)
    {}

    explicit list(const typename base_t::allocator_type& a)
        : base_t(a)
    {}
#ifdef NX_CC_MSVC
    explicit list(typename base_t::size_type n,
                  const typename base_t::value_type& v = base_t::value_type(),
                  const typename base_t::allocator_type& a = base_t::allocator_type())
        : base_t(n, v, a)
    {}
#elif defined(NX_CC_GNUC)
    explicit list(typename base_t::size_type n,
                  const typename base_t::value_type& v = typename base_t::value_type(),
                  const typename base_t::allocator_type& a = typename base_t::allocator_type())
        : base_t(n, v, a)
    {}
#endif

    template <typename Iterator_>
    list(Iterator_ f,
         Iterator_ l,
         const typename base_t::allocator_type& a = typename base_t::allocator_type())
        : base_t(f, l, a)
    {}
};

//////////////////////////////////////////////////////////////////////////
NX_END
//////////////////////////////////////////////////////////////////////////
